package com.xinqi.modules.chat.favorite.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.modules.chat.favorite.domain.FavoriteContentEntity;
import com.xinqi.common.mybatis.data.repo.SuperMapper;
import com.xinqi.modules.chat.favorite.dto.req.FavoriteContentCreateDTO;
import com.xinqi.modules.chat.favorite.dto.req.FavoriteContentQueryDTO;
import com.xinqi.modules.chat.favorite.dto.rsp.FavoriteContentResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 收藏内容表数据层
 *
 * @author: yyzhen
 * @date: 2023/03/23
 */
@Mapper
public interface FavoriteContentMapper extends SuperMapper<FavoriteContentEntity> {

    /**
     * 分页列表
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<FavoriteContentResultDTO> selectPage1(Page page, @Param(Constants.WRAPPER) FavoriteContentQueryDTO queryWrapper);

    /**
     * 根据ID获取详情
     *
     * @param id
     * @return
     */
    FavoriteContentResultDTO selectFavoriteContentById(@Param("id") Long id);

    /**
     * 根据收藏内容检索重复收藏内容信息
     *
     * @param list
     * @return List<FavoriteContentEntity>
     */
    List<FavoriteContentEntity> selectFavoriteContentList(@Param("list") List<FavoriteContentCreateDTO> list, @Param("userId") Long userId);

}
